﻿namespace Cloudio.Web.UI.Ide
{
    using System;
    using System.Web.UI.WebControls;
    using Gaia.WebWidgets.Extensions;
    using Dock;

    /// <summary>
    /// Provides a user interface for browsing the properties of an object
    /// </summary>
    public class PropertyGrid: DockingContainer
    {
        private readonly ExtendedPanel _propertyGrid;

        public PropertyGrid()
        {
            _propertyGrid = new ExtendedPanel {Caption = "Properties", ScrollBars = ScrollBars.None, CssClass = "gaiax"};
        }

        public string Caption
        {
            set
            {
                _propertyGrid.Caption = value;
            }
        }
       
        protected override void OnInit(EventArgs e)
        {
            ID = "propertyGrid";
            DockingItems.Add(_propertyGrid);
            base.OnInit(e);
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
        }

        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }

        /// <summary>
        /// Gets or sets the object for which the grid displays properties.
        /// </summary>
        public object SelectedObject { get; set; }
    }
}
